<template>
  <div>
    <UserForm @onSubmit="onSubmit" :isRegister="true"></UserForm>
  </div>

</template>

<script>
import { registerAPI } from '@/api/registerapi'
import UserForm from '../components/userForm.vue'

export default {
  name: 'Register-Page',
  components: {
    UserForm
  },
  data () {
    return {
      username: '',
      password: ''
    }
  },
  methods: {
    async onSubmit (values) {
      await registerAPI(values)
      this.$toast('注册成功')
      this.$router.push('/login')
    }
  }
}
</script>

<style lang="less" scoped>
  .link {
    color: #069;
    font-size: 12px;
    padding-right: 20px;
    float: right;
  }
</style>
